<?php
/**
 * @var $data Video
 * @var $image Image
 */
$thumb ='';
$url = $this->createUrl('view', array('vid' => $data->id, 'title' => Yii::app()->func->safeTitle($data->title)));
if($data->img){
	
	Yii::import('application.extensions.image.Image');
	$image = new Image(Yii::getPathOfAlias('webroot').'/'.$data->img);
	$image->resize(250, 100);
	$thumb = '/upload/images/thumb/'.substr_replace($data->img,'',0,14);
	$image->save(Yii::getPathOfAlias('webroot').$thumb);
	
}

?>
<div class="item">
<div class="img"><a href="<?php echo $url; ?>"> <img
	src="<?php echo Yii::app()->baseUrl.$thumb; ?>"></a></div>
<div class="title"><?php echo CHtml::link(CHtml::encode($data->title), $url); ?>
</div>
<abbr class="date">Lượt xem: <?php echo $data->view; ?></abbr> <!--    <div class="date">--><?php //echo date('d/m/Y',$data->create_time); ?><!--</div>-->

</div>
